/*
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2021. All rights reserved.
* gazelle is licensed under the Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
*     http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
* PURPOSE.
* See the Mulan PSL v2 for more details.
*/

#ifndef _LSTACK_RULE_H_
#define _LSTACK_RULE_H_

struct vdev_rule_reg_ops {
    int (*reg_listen_port)(struct gazelle_quintuple *qtuple, uint16_t queue_id, enum reg_ring_type type);
    int (*unreg_listen_port)(struct gazelle_quintuple *qtuple, uint16_t queue_id, enum reg_ring_type type);
    int (*reg_conn)(struct gazelle_quintuple *qtuple, uint16_t queue_id, enum reg_ring_type type);
    int (*unreg_conn)(struct gazelle_quintuple *qtuple, uint16_t queue_id, enum reg_ring_type type);
    int (*find_conn)(struct gazelle_quintuple *qtuple, uint16_t queue_id, enum reg_ring_type type);
    int (*find_listen_port)(struct gazelle_quintuple *qtuple, uint16_t queue_id, enum reg_ring_type type);
};

int vdev_rule_register(struct vdev_rule_reg_ops *ops);
int32_t vdev_reg_xmit(enum reg_ring_type type, struct gazelle_quintuple *qtuple);

void vdev_soft_rule_ops_init(void);
void vdev_ltran_rule_ops_init(void);

#endif
